<script>
$(document).ready(function() {
    //prepare the dialog
	
    $( "#thongbao" ).dialog({
		title: "Thông báo",
        autoOpen: false,
        show: {
            effect: "blind",
            duration: 500
            },
        hide: {
            effect: "blind",
            duration: 500
            },
        modal: true,
		buttons: {
			 "Ok": function() {
				location.reload();
				 $('#thongbao').dialog('close');
			}
		 }
        });

		$(".close_editservice").click(function(event) {
				$('#dialogModal').dialog('close');
			});
   
    });
</script>
<?php echo $this->Form->create('Service'); ?>
<div class="row">
	<label>Tên dịch vụ</label>
	<?php echo $this->Form->input('name',array('label'=>false, 'style'=>'max-width:256px;','div'=>false));?>
</div>		
<div class="row">
	<label>Giá dịch vụ VNĐ</label>
	<?php  echo $this->Form->input('price',array('label'=>false,'div'=>false,'id'=>'demo9','type'=>'text'));?>
	<script type="text/javascript">$("#demo9").maskMoney();</script>
</div>
<div class="row">
	<label>Đơn vị</label>
	<?php echo $this->Form->input('unit',array('label'=>false, 'style'=>'max-width:256px;','div'=>false));?>
</div>
<div class="row">
	<label>Nhóm dịch vụ</label>
	<?php echo $this->Form->input('cate_services_id',array('label'=>false, 'style'=>'max-width:256px;','div'=>false));?>
</div>		
<div class="row">
	<label>Thứ tự</label>
	<?php echo $this->Form->input('orders',array('label'=>false,'type'=>'text', 'style'=>'max-width:256px;','div'=>false));?>
</div>
<div class="row">
	<label>Thông tin thêm</label>
	<?php  echo $this->Form->input('note',array('label'=>false,'div'=>false));?>
</div>
<div class="row">
	<?php echo $this->Form->input('status',array('type'=>'checkbox','label'=>'Cho phép nhập kho', 'style'=>'max-width:256px;','div'=>false));?>
	
</div>
<div class="btn-dialog">

<?php 
echo $this->Js->submit('Cập nhật', array(  //create 'ajax' save button
	'update' => '#contentWrap','div'=>false  //id of DOM element to update with selector
	));
if (false != $saved){ //will only be true if saved OK in controller from ajax save above
	echo "<script>
		$('#thongbao').dialog('open');  //close containing dialog         
	   
	</script>";
	}
echo $this->Form->end();
echo $this->Js->writeBuffer();
?>
<input type="button" value="Cancel" class="close_editservice">
</div>

<div id="thongbao" title="Thông báo">
<p align="center">Đã cập nhật thành công</p>
</div>